package com.hubei.car.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;

import java.sql.Timestamp;

/**
 * 资讯
 * @author huanghaisheng
 * @create 2019-11-27
 */
@ApiModel(value="资讯")
@Data
@TableName(value = "ms_news")
@Accessors(chain = true)
public class MsNews {

    @TableId(value = "id",type = IdType.AUTO)
    @ApiModelProperty(value="资讯id,修改时必填，增加时不填")
    private Long id;

    @TableField(value = "title")
    @ApiModelProperty(value="资讯标题", required = true)
    private String title;

    @TableField(value = "tid")
    @ApiModelProperty(value="资讯类型id")
    private Long tid;

    @TableField(exist = false)
    @ApiModelProperty(value="资讯类型", hidden = true)
    private MsNewsType msNewsType;

    @TableField(value = "contents")
    @ApiModelProperty(value="资讯内容富文本")
    private String contents;

    @TableField(value = "readcnt")
    @ApiModelProperty(value="阅读次数", hidden = true)
    private Long readcnt;

    @TableField(value = "createdate")
    @ApiModelProperty(value="创建日期", hidden = true)
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Timestamp createdate;

    @TableField(value = "createid")
    @ApiModelProperty(value="创建人id", hidden = true)
    private Long createid;

    @TableField(value = "createname")
    @ApiModelProperty(value="创建人", hidden = true)
    private String createname;

    @TableField(value = "defaultimages")
    @ApiModelProperty(value="默认图地址，可以逗号分割存储多张图路径")
    private String defaultimages;

    @TableField(value = "istop")
    @ApiModelProperty(value="是否置顶")
    private Boolean istop;

    @TableField(value = "isrecommend")
    @ApiModelProperty(value="是否推荐")
    private Boolean isrecommend;

    @TableField(value = "isstop")
    @ApiModelProperty(value="是否禁用")
    private Boolean isstop;

    @TableField(value = "sort")
    @ApiModelProperty(value="排序")
    private Integer sort;

}
